#include<stdio.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/wait.h>
#include<stdlib.h>
int main()
{
   pid_t id= fork(); 
   if(id == 0 )
   {
     printf("我是子进程，pid=%d\n",getpid());
     exit(20);
   }
   printf("父进程正在等待\n");
   if(wait(NULL))
     printf("等待成功\n");
    waitpid(20000,NULL,0);
    perror("wait failed:\n");
    return 0;
}
